package com.mc.moring.widge;

import android.app.AlertDialog;
import android.content.Context;
import android.os.Bundle;
import android.text.TextUtils;
import android.widget.TextView;

import com.mc.moring.R;


public class LoadingAlertDialog extends AlertDialog {
    private TextView tvMiddleTextView;
    public LoadingAlertDialog(Context context) {
        super(context, R.style.LoadDialogStyle);
        setCanceledOnTouchOutside(false);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.view_dialog_loading);
        tvMiddleTextView = this.findViewById(R.id.tv_view_dialog_loading_text);
    }


    public void setCancel(boolean b){
        setCancelable(b);
    }


    public void setTextMiddleValue(String textValue){
        if (!TextUtils.isEmpty(textValue)){
            tvMiddleTextView.setText(textValue);
        }
    }

    @Override
    public void show() {
        super.show();
    }

    @Override
    public void dismiss() {
        super.dismiss();
    }

}
